﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Shove.Web.UI;

public partial class UserControls_Service : UCBase 
{
    public UserControls_Service()
    {
        Name = "客服中心";

        //swpas = new ShoveWebPartAttribute[13];

        //swpas[0] = new ShoveWebPartAttribute_Int("控件宽度", "1,1000", 180, "控件宽度");
        //swpas[1] = new ShoveWebPartAttribute_Int("导航高度", "1,300", 28, "导航高度");
        //swpas[2] = new ShoveWebPartAttribute_Int("导航背景图片单元格宽度", "1,600", 106, "导航背景图片单元格宽度");
        //swpas[3] = new ShoveWebPartAttribute_Int("常见问题行宽度", "1,1000", 170, "常见问题行宽度");
        //swpas[4] = new ShoveWebPartAttribute_Int("常见问题单元格宽度", "1,600", 160, "常见问题单元格宽度");

        //swpas[5] = new ShoveWebPartAttribute_Text("导航字体CSS样式", "", "title14_bai", "导航字体CSS样式");
        //swpas[6] = new ShoveWebPartAttribute_Text("常见问题CSS样式", "", "black12", "常见问题CSS样式");

        //swpas[7] = new ShoveWebPartAttribute_Image("导航背景图片1", "", "images/title_bg_1.jpg", "导航背景图片1");
        //swpas[8] = new ShoveWebPartAttribute_Image("导航背景图片2", "", "images/title_bg_hui.jpg", "导航背景图片2");
        //swpas[9] = new ShoveWebPartAttribute_Image("分割线图片", "", "images/category_bg_2.jpg", "分割线图片");
        //swpas[10] = new ShoveWebPartAttribute_Image("标题前小图片", "", "images/point_bg.jpg", "标题前小图片");
       
        //swpas[11] = new ShoveWebPartAttribute_Color("控件边框颜色", "#cccccc", "控件边框颜色");

        //swpas[12] = new ShoveWebPartAttribute_Int("常见问题行高", "1,400", 26, "常见问题行高");
    }

    private void Initlayout()
    {
        //tabctr.Width = swpAttributes[0];
        //tabctr.BgColor = swpAttributes[11];

        //tdhelp.Height = swpAttributes[1];
        //tdhelp.Attributes.Add("class", swpAttributes[5]);
        //tdhelp.Style.Add("background-image","url('"+swpAttributes[7]+"')");
        //tdhelp.Width = swpAttributes[2];

        //tdspace.Style.Add("background-image", "url('" + swpAttributes[8] + "')");
        //tdspace.Width =(Shove._Convert.StrToInt(swpAttributes[0], 180) - Shove._Convert.StrToInt(swpAttributes[2], 106)).ToString();

        //tab1.Width = swpAttributes[3];
        //tab1.Style.Add("background-image", "url('" + swpAttributes[9] + "')");
        //imgpoint.Src = "~/" + swpAttributes[10];
        //tdquest.Height = swpAttributes[12];
        //tdquest.Attributes.Add("class", swpAttributes[6]);
        //tdquest.Width = swpAttributes[4];

        //tab2.Width = swpAttributes[3];
        //tab2.Style.Add("background-image", "url('" + swpAttributes[9] + "')");
        //imgpoint1.Src = "~/" + swpAttributes[10];
        //tdzhinan.Height = swpAttributes[12];
        //tdzhinan.Attributes.Add("class", swpAttributes[6]);
        //tdzhinan.Width = swpAttributes[4];

        //tab3.Width = swpAttributes[3];
        //tab3.Style.Add("background-image", "url('" + swpAttributes[9] + "')");
        //imgpoint2.Src = "~/" + swpAttributes[10];
        //tdhelpUs.Height = swpAttributes[12];
        //tdhelpUs.Attributes.Add("class", swpAttributes[6]);
        //tdhelpUs.Width = swpAttributes[4];

        //tab4.Width = swpAttributes[3];
        //tab4.Style.Add("background-image", "url('" + swpAttributes[9] + "')");
        //imgpoint3.Src = "~/" + swpAttributes[10];
        //tdlinkus.Height = swpAttributes[12];
        //tdlinkus.Attributes.Add("class", swpAttributes[6]);
        //tdlinkus.Width = swpAttributes[4];

        //tab5.Width = swpAttributes[3];
        //tab5.Style.Add("background-image", "url('" + swpAttributes[9] + "')");
        //imgpoint4.Src = "~/" + swpAttributes[10];
        //tdabout.Height = swpAttributes[12];
        //tdabout.Attributes.Add("class", swpAttributes[6]);
        //tdabout.Width = swpAttributes[4];
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        Page1.PageSize = 4;

        Initlayout();
        BindData();
    }

    /// <summary>
    /// 根据所点击的  常见问题5 购物指南2 帮助中心4 付款方式3  配送方式6 人才招聘7
    /// </summary>
    private void BindData()
    {
        hType.Value = Shove._Web.Utility.GetRequest("Type");

        long ShopID = _Site.ID;
        long ArticleTypeID = Shove._Convert.StrToLong(hType.Value, 5);

        switch (ArticleTypeID)
        {
            case 5:
                lbTitle.Text = "常见问题";
                break;
            case 2:
                lbTitle.Text = "购物指南";
                break;
            case 4:
                lbTitle.Text = "帮助中心";
                break;
            case 3:
                lbTitle.Text = "付款方式";
                break;
            case 6:
                lbTitle.Text = "配送方式";
                break;
            case 7:
                lbTitle.Text = "人才招聘";
                break;
        }

        this.Page1.FindType = 0;
        this.Page1.Field1 = "";
        this.Page1.Field2 = "";
        this.Page1.Like1 = "";
        this.Page1.Like2 = "";

        Page1.DataListID = dlArticleList;
        Page1.TableName = "V_Site_Article";
        Page1.Condition = " where ShopID=" + ShopID + " and ArticleTypeID=" + ArticleTypeID;
    }
    
}
